<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>News</title>

    <link href="../css/bootstrap.min.css?v=3.3.6" rel="stylesheet">
    <link href="../css/font-awesome.min.css?v=4.4.0" rel="stylesheet">
    <link href="../css/animate.css" rel="stylesheet">
    <link href="../css/style.css?v=4.1.0" rel="stylesheet">
    <link href="../css/plugins/treeview/bootstrap-treeview.css" rel="stylesheet">
    <link rel="stylesheet" href="../css/scholar/newsDetail.css">
</head>

<body style="background-color: #eef3fa">
<div class="content" id="box" v-cloak>
    <div class="row header">
        <div class="container">
            <!--<div class="header-logo">NexMagic scholar</div>-->
            <span class="header-logo"><img src="../img/scholar/logo1.png" style="height:25px;margin-bottom:15px;"/></span>
        </div>
    </div>
    <div class="container margin-content"  id="news">
        <div class="title">
             {{news.titleSrc}}
        </div>
        <div class="mediaName">
            <span>{{news.mediaNameSrc}}</span>
            <span>{{news.pubTime}}</span>
            <span class="link"><a :href="news.url" target="_blank"><i class="fa fa-link" aria-hidden="true"></i>Link</a></span>
        </div>
        <hr>
        <div class="new-content">
            <p v-html="news.textSrc_"></p>
        </div>
    </div>
    <div class="container margin-content" id="socials">
        <div class="title">
            {{socials.title}}
        </div>
        <div class="mediaName">
            <span>{{socials.sourceType}}</span>
            <span>{{socials.time}}</span>
            <span class="link"><a :href="socials.url" target="_blank"><i class="fa fa-link" aria-hidden="true"></i>Link</a></span>
        </div>
        <hr>
        <div class="new-content">
            <p v-html="socials.text"></p>
        </div>
    </div>
</div>
<script src="../js/jquery.min.js"></script>
<script src="../js/bootstrap.min.js"></script>
<script src="../js/polyfill.min.js"></script>
<script src="../js/vue.min.js"></script>
<script src="../js/echarts/echarts.min.js"></script>
<script src="../js/echarts/macarons.js"></script>
<script src="../js/echarts/dataTool.min.js"></script>
<script src="../js/echarts/world.js"></script>
<script src="../js/gAjax.js"></script>
<script>
    var KingVue = new Vue({
        el: '#box',
        data: {
            // resourceUrl: "",
            news: {},
            socials:{}
        },
        mounted: function () {
            var _this = this;
            var type = getUrlParam("type");

            console.log(type);
            if(type == 1){
                $("#socials").hide()
                _this.queryNewsDetail();
            }
            if(type == 2){
                $("#news").hide()
                _this.querySocialsDetail();
            }

        },
        methods: {
            queryNewsDetail: function () {/*查新闻详细信息*/
                var _this = this;
                gAjax.requestNoAsync("neo4j/news/queryUnique", {id: getUrlParam("id")}).then(function (result) {
                    _this.news = result;
                    console.log(_this.news);
                });
            },

            querySocialsDetail: function () {/*查社交媒体详细信息*/
                var _this = this;
                gAjax.requestNoAsync("neo4j/social/queryUnique", {id: getUrlParam("id")}).then(function (result) {
                    console.log(result);
                    _this.socials = result;
                });
            },
        }
    });
</script>
</body>
</html>